package learn.up.java.strings;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;
import java.util.Arrays;

import org.apache.commons.lang.StringUtils;

public class Stringutil {

	public static void main(String[] args) throws UnsupportedEncodingException {
		String[] str= 
			{"1abc","Cbbb","Dccc","acdb","2bcd"," 2bc","2Bcde","2bcde","2bcd1","2bcdef"};
		Arrays.sort(str, String.CASE_INSENSITIVE_ORDER);
		for(String s:str) {
			System.out.print(s+" ");
		}
		System.out.println();
		String arr="a+vasd+f123encoding=\"123423\"ga345encoding=12342233";
		arr=arr.replaceFirst("encoding=\".*\"","encoding=utf-8");
		System.out.println(arr);
		arr=URLEncoder.encode(arr, "UTF-8").replace("+", "%2");
		
		System.out.println(arr);
		
		System.out.println();
		String s=StringUtils.join(str,":");
		System.out.println(s);
		System.out.println(s.compareTo("bbc"));//
		System.out.println("1".compareTo("zh"));//�����ȥǰ��
		
	}

}
